﻿/** Copyright © 2010-2015 Vahid Jalili
 * 
 * This file is part of ReShapes project.
 * ReShapes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 * ReShapes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with Foobar. If not, see http://www.gnu.org/licenses/.
 **/

using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;

namespace ReShapes
{
    /// <summary>
    /// Interaction logic for my_MessageBox.xaml
    /// </summary>
    public partial class my_MessageBox : Window
    {
        string rtn_str = "Hamed";

        public my_MessageBox()
        {
            InitializeComponent();
        }

        public void Show(string Message, int Message_Type)
        {
            switch (Message_Type)
            {
                case 1: // Yes No type
                    OK_BT.Visibility = Visibility.Hidden;
                    NO_BT.Visibility = Visibility.Visible;
                    YES_BT.Visibility = Visibility.Visible;
                    break;

                case 2: // only OK 
                    OK_BT.Visibility = Visibility.Visible;
                    NO_BT.Visibility = Visibility.Hidden;
                    YES_BT.Visibility = Visibility.Hidden;
                    break;

            }

            FlowDocument s = new FlowDocument();
            Paragraph sp = new Paragraph();
            sp.Inlines.Add(Message);
            s.Blocks.Add(sp);
            Message_txt.Document = s;
        }


        private void YES_BT_MouseEnter(object sender, MouseEventArgs e)
        {
            YES_BT.Foreground = new SolidColorBrush(Colors.Yellow);
        }
        private void YES_BT_MouseLeave(object sender, MouseEventArgs e)
        {
            YES_BT.Foreground = new SolidColorBrush(Color.FromArgb(255, 128, 128, 128));
        }
        private void YES_BT_MouseDown(object sender, MouseButtonEventArgs e)
        {
            rtn_str = "YES";
            this.Close();
        }


        private void NO_BT_MouseEnter(object sender, MouseEventArgs e)
        {
            NO_BT.Foreground = new SolidColorBrush(Colors.Yellow);
        }
        private void NO_BT_MouseLeave(object sender, MouseEventArgs e)
        {
            NO_BT.Foreground = new SolidColorBrush(Color.FromArgb(255, 128, 128, 128));
        }
        private void NO_BT_MouseDown(object sender, MouseButtonEventArgs e)
        {
            rtn_str = "NO";
            this.Close();
        }


        private void OK_BT_MouseEnter(object sender, MouseEventArgs e)
        {
            OK_BT.Foreground = new SolidColorBrush(Colors.Yellow);
        }
        private void OK_BT_MouseLeave(object sender, MouseEventArgs e)
        {
            OK_BT.Foreground = new SolidColorBrush(Color.FromArgb(255, 128, 128, 128));
        }
        private void OK_BT_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }



        public string Result()
        {
            return rtn_str;
        }

        

        

        

        

        
    }
}
